<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../resct18/react.development.js"></script>
    <script src="../resct18/react-dom.development.js"></script>
    <script src="../resct18/babel.min.js"></script>
</head>
<body>
    <div id="app"></div>
    <button id="btn">修改vDOM重新渲染</button>
    <script type="text/babel">
        class Content extends React.Component{
            state={
                content:'你好',
                coutn:0,
                isHot:true
            }
            //render是原型对象上的方法 原型对象身上的方法只有实例化对象可以用 所以它的this指向组件实例(实例化对象)
            render (){
                const {content,coutn,isHot}=this.state
                return(
                <div>
                    <p>{content}</p>
                    <h1>{coutn}</h1>
                    <p>{isHot?'热':'冷'}</p>
                </div>
                )
            }
        }
        const root = ReactDOM.createRoot(document.getElementById('app'))
        root.render(<Content/>)

    </script>
</body>
</html>